home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / TSMTE.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  5.0 KB  |  180 lines  |  [TEXT/MMCC]

  1. /*
  2.      File:        TSMTE.h
  3.  
  4.      Contains:    Text Services Managerfor TextEdit Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __TSMTE__
  21. #define __TSMTE__
  22.  
  23.  
  24. #ifndef __TEXTEDIT__
  25. #include <TextEdit.h>
  26. #endif
  27. /*    #include <Types.h>                                            */
  28. /*        #include <ConditionalMacros.h>                            */
  29. /*    #include <Quickdraw.h>                                        */
  30. /*        #include <MixedMode.h>                                    */
  31. /*        #include <QuickdrawText.h>                                */
  32.  
  33. #ifndef __DIALOGS__
  34. #include <Dialogs.h>
  35. #endif
  36. /*    #include <Errors.h>                                            */
  37. /*    #include <Memory.h>                                            */
  38. /*    #include <Windows.h>                                        */
  39. /*        #include <Events.h>                                        */
  40. /*            #include <OSUtils.h>                                */
  41. /*        #include <Controls.h>                                    */
  42. /*            #include <Menus.h>                                    */
  43.  
  44. #ifndef __APPLEEVENTS__
  45. #include <AppleEvents.h>
  46. #endif
  47. /*    #include <EPPC.h>                                            */
  48. /*        #include <AppleTalk.h>                                    */
  49. /*        #include <Files.h>                                        */
  50. /*        #include <PPCToolbox.h>                                    */
  51. /*        #include <Processes.h>                                    */
  52. /*    #include <Notification.h>                                    */
  53.  
  54. #ifndef __TEXTSERVICES__
  55. #include <TextServices.h>
  56. #endif
  57. /*    #include <Components.h>                                        */
  58.  
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif
  62.  
  63. #if PRAGMA_ALIGN_SUPPORTED
  64. #pragma options align=mac68k
  65. #endif
  66.  
  67. #if PRAGMA_IMPORT_SUPPORTED
  68. #pragma import on
  69. #endif
  70.  
  71.  
  72. enum {
  73.     kTSMTESignature                = 'tmTE',
  74.     kTSMTEInterfaceType            = 'tmTE',
  75.     kTSMTEDialog                = 'tmDI'
  76. };
  77.  
  78.  
  79. enum {
  80.     gestaltTSMTEAttr            = 'tmTE',
  81.     gestaltTSMTEPresent            = 0,
  82.     gestaltTSMTE                = 0                                /* gestaltTSMTE is old name for gestaltTSMTEPresent */
  83. };
  84.  
  85. enum {
  86.     gestaltTSMTEVersion            = 'tmTV',
  87.     gestaltTSMTE1                = 0x100
  88. };
  89.  
  90. enum {
  91.     kTSMTEAutoScroll            = 1
  92. };
  93.  
  94. /* callback procedure definitions*/
  95. typedef pascal void (*TSMTEPreUpdateProcPtr)(TEHandle textH, long refCon);
  96. typedef pascal void (*TSMTEPostUpdateProcPtr)(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
  97.  
  98. #if GENERATINGCFM
  99. typedef UniversalProcPtr TSMTEPreUpdateUPP;
  100. typedef UniversalProcPtr TSMTEPostUpdateUPP;
  101. #else
  102. typedef TSMTEPreUpdateProcPtr TSMTEPreUpdateUPP;
  103. typedef TSMTEPostUpdateProcPtr TSMTEPostUpdateUPP;
  104. #endif
  105.  
  106. struct TSMTERec {
  107.     TEHandle                        textH;
  108.     TSMTEPreUpdateUPP                preUpdateProc;
  109.     TSMTEPostUpdateUPP                postUpdateProc;
  110.     long                            updateFlag;
  111.     long                            refCon;
  112. };
  113. typedef struct TSMTERec TSMTERec, *TSMTERecPtr, **TSMTERecHandle;
  114.  
  115. struct TSMDialogRecord {
  116.     DialogRecord                    fDialog;
  117.     TSMDocumentID                    fDocID;
  118.     TSMTERecHandle                    fTSMTERecH;
  119.     long                            fTSMTERsvd[3];                /* reserved*/
  120. };
  121. typedef struct TSMDialogRecord TSMDialogRecord, *TSMDialogPeek;
  122.  
  123.  
  124. #if GENERATINGCFM
  125. #else
  126. #endif
  127.  
  128. enum {
  129.     uppTSMTEPreUpdateProcInfo = kPascalStackBased
  130.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  131.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  132.     uppTSMTEPostUpdateProcInfo = kPascalStackBased
  133.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  134.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  135.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  136.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  137.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  138.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  139.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(long)))
  140. };
  141.  
  142. #if GENERATINGCFM
  143. #define NewTSMTEPreUpdateProc(userRoutine)        \
  144.         (TSMTEPreUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, GetCurrentArchitecture())
  145. #define NewTSMTEPostUpdateProc(userRoutine)        \
  146.         (TSMTEPostUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, GetCurrentArchitecture())
  147. #else
  148. #define NewTSMTEPreUpdateProc(userRoutine)        \
  149.         ((TSMTEPreUpdateUPP) (userRoutine))
  150. #define NewTSMTEPostUpdateProc(userRoutine)        \
  151.         ((TSMTEPostUpdateUPP) (userRoutine))
  152. #endif
  153.  
  154. #if GENERATINGCFM
  155. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  156.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, (textH), (refCon))
  157. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  158.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, (textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  159. #else
  160. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  161.         (*(userRoutine))((textH), (refCon))
  162. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  163.         (*(userRoutine))((textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  164. #endif
  165.  
  166.  
  167. #if PRAGMA_IMPORT_SUPPORTED
  168. #pragma import off
  169. #endif
  170.  
  171. #if PRAGMA_ALIGN_SUPPORTED
  172. #pragma options align=reset
  173. #endif
  174.  
  175. #ifdef __cplusplus
  176. }
  177. #endif
  178.  
  179. #endif /* __TSMTE__ */
  180.